<template>
  <view class="service-data">
    <view class="sd-header">
      {{ serviceInfo.store_highlight }}
    </view>
    <view class="sd-label">
      <view class="label">餐饮加盟</view>
      <view class="label">服务范围：北京市</view>
    </view>
    <view class="sd-title">
      排骨米饭快餐加盟，优选食材品质当先，具备非常强的市场竞争力，出餐快，可堂食可外卖，无需经验，3天学卡萨丁放开接啊
    </view>
    <view class="sd-image" v-if="serviceImage.length > 0">
      <image
        class="image"
        @click.stop="previewImage(index, serviceImage)"
        v-for="(img, index) in serviceImage"
        :key="img"
        :src="img"
        mode="aspectFill"
      />
    </view>
    <view class="sd-operate">
      <img class="icon" src="../image/phone-icon.png" mode="widthFix" />免费拨打
    </view>
    <img class="sd-top" src="../image/top-img.png" mode="widthFix" />
  </view>
</template>

<script>
export default {
  name: "ServiceData",
  props: {
    serviceImage:{
      type: Array,
      default: () => {
        return [];
      }
    },
    serviceInfo: {
      type: Object,
      default: () => {
        return {};
      }
    }
  },
  data() {
    return {};
  },
  methods: {
    previewImage(index, imageList) {
      uni.previewImage({
        current: index,
        urls: imageList
      });
    }
  }
};
</script>

<style scoped lang="scss">
.service-data {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  padding: 20px 10px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  border: 1px solid #dff0ff;
  border-radius: 10px;
  box-shadow: 0px 3px 10px 0px rgba(0, 0, 0, 0.0275);
  background: #f9fcff;
  .sd-header {
    color: #333333;
    font-size: 16px;
    font-weight: 600;
  }
  .sd-label {
    margin-top: 10px;
    display: flex;
    .label {
      height: 22px;
      padding: 0 8px;
      margin-right: 6px;
      color: #53ce78;
      font-weight: 400;
      background: rgba(62, 166, 255, 0);
      border: 1px solid #53ce78;
      border-radius: 3px;
    }
  }
  .sd-title {
    width: 100%;
    margin-top: 10px;
    font-size: 13px;
    color: #555555;
    line-height: 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .sd-image {
    display: flex;
    margin-bottom: 10px;
    .image {
      margin-right: 10px;
      width: 76px;
      height: 76px;
      border-radius: 6px;
    }
  }
  .sd-operate {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
    width: 100%;
    height: 36px;
    border-radius: 18px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background: #53ce78;
    .icon {
      width: 18px;
      height: 18px;
      margin-right: 6px;
    }
  }
  .sd-top {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 36px;
    height: 36px;
  }
}
</style>
